// This example demonstrates how to programmatically add comments using VS Code API
// Run this code from the VS Code Debug Console or as a VSCode Extension API client

/**
 * Example function to add a comment at a specific line in the active editor
 * @param {number} lineNumber - 0-based line number where to add the comment
 * @param {string} commentText - Text content for the comment
 */
function addCommentAtLine(lineNumber, commentText) {
    // Execute the command we defined in our extension
    return vscode.commands.executeCommand('mywiki.programmaticAddComment', lineNumber, commentText);
}

/**
 * Example function to add multiple comments at once
 * @param {Array<{lineNumber: number, text: string}>} comments - Array of comments to add
 */
async function addMultipleComments(comments) {
    for (const comment of comments) {
        await addCommentAtLine(comment.lineNumber, comment.text);
    }
}

// Usage examples:

// 1. Add a single comment at line 5 (line numbers are 0-based in the API)
// addCommentAtLine(4, "This is a comment at line 5");

// 2. Add multiple comments
// addMultipleComments([
//     { lineNumber: 9, text: "This is a comment at line 10" },
//     { lineNumber: 19, text: "This is a comment at line 20" },
//     { lineNumber: 29, text: "This is a comment at line 30" }
// ]);

// To use this from the Debug Console:
// 1. Open a file in the editor where you want to add comments
// 2. Open Debug Console (Ctrl+Shift+Y or View > Debug Console)
// 3. Copy and paste one of the usage examples (without the comment marks)
// 4. Press Enter to execute 